package com.ez.supervise.dao.impl;

import java.util.List;

import com.ez.supervise.dao.RolePermissionDao;
import com.ez.supervise.dao.base.BaseDaoImpl;
import com.ez.supervise.model.sys.RolePermission;

public class RolePermissionDaoImpl extends BaseDaoImpl implements RolePermissionDao {

    public void insert(Object rolePermission) {
	sqlMapClientTemplate.insert("sys.insertRolePermission", rolePermission);
    }

    public Object get(Long id) {
	return (RolePermission) sqlMapClientTemplate.queryForObject("sys.getRolePermissionById", id);
    }

    public void update(Object rolePermission) {
	sqlMapClientTemplate.update("sys.updateRolePermission", rolePermission);
    }

    public List findPermissionByRoleId(Long roleId) {
	return sqlMapClientTemplate.queryForList("sys.findPermissionByRoleId", roleId);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.ez.supervise.dao.RolePermissionDao#deleteRolePermissionByRoleId(java
     * .lang.Long)
     */
    public void deleteRolePermissionByRoleId(Long roleId) {
	sqlMapClientTemplate.delete("sys.deleteRolePermissionByRoleId", roleId);

    }

}
